package du.zhaofeng2019;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SQLHelper extends SQLiteOpenHelper {


    public static String KEY_TABLE = "workmate";

    public static String KEY_ID = "_id";  // 主键
    public static String KEY_NAME = "name";    //姓名
    public static String KEY_UNIT = "unit";    //单位
    public static String KEY_DEPT = "dept";    //办公室，工作地点，工作房间
    public static String KEY_TITLES = "titles";    // 头衔:领导，行政，教师，职工等
    public static String KEY_OFFICEPHONES = "officePhones";       //办公室电话
    public static String KEY_HOMEPHONES = "homePhones";     //宅电
    public static String KEY_MOBILEPHONES = "mobilePhones";  //手机
    public static String KEY_ADDRESSES = "addresses";   //  住址
    public static String KEY_QQS = "QQs";   //  QQ
    public static String KEY_WEIXINS = "weixins";    //  微信
    public static String KEY_EMAILS = "emails";     //   邮箱
    public static String KEY_TEAMS = "teams";   //   组属，团体


    public static String[] columns = new String[]{
            KEY_ID,
            KEY_NAME,
            KEY_UNIT,
            KEY_DEPT,
            KEY_TITLES,
            KEY_OFFICEPHONES,
            KEY_HOMEPHONES,
            KEY_MOBILEPHONES,
            KEY_ADDRESSES,
            KEY_QQS,
            KEY_WEIXINS,
            KEY_EMAILS,
            KEY_TEAMS,
    };

    public static String[] columnsHZ = new String[]{
            "主键", "姓名", "单位", "办公室", "头衔", "办公电话", "宅电", "手机", "住址", "QQ", "微信", "邮箱", "团体",
    };


    public SQLHelper(Context context) {
        super(context, "tel2019.db", null, 1);
    }


    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {

        sqLiteDatabase.execSQL(

                "CREATE TABLE workmate ("
                        + "	 _id integer primary key not null,"// 主键
                        + "  name text, "   //姓名
                        + "  unit text, "   //单位
                        + "  dept text, "   //办公室，工作地点，工作房间
                        + "  titles text, "   // 头衔:领导，行政，教师，职工等
                        + "  officePhones text, "      //办公室电话
                        + "  homePhones text, "    //宅电
                        + "  mobilePhones text, " //手机
                        + "  addresses text, "  //住址
                        + "  QQs text, "  //  QQ
                        + "  weixins text, "   //  微信
                        + "  emails text, "    //   邮箱
                        + "  teams text )"  //   组属，团体
        );


    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
        // nothing to do
    }

}
